package aibili.ronaldo.config;

import aibili.ronaldo.domain.FileConfig;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

@Configuration
public class ResourceConfig implements WebMvcConfigurer {
    //file save path
    public static final String FILE_PATH = "/filepath/";


    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        /** file upload path */
        registry.addResourceHandler("/filepath/**").
                addResourceLocations("file:" + FileConfig.getSavePath());
    }
}
